1. Field of the Invention
The present invention relates to a method and apparatus for processing information, and more particularly, to a method and apparatus for encoding image data.
2. Description of the Related Art
In a data encoding technique widely used to encode digital monochrome binary image data, image data is encoded raster by raster. For example, in MH, MR, and MMR techniques used in facsimiles, variable-length encoding is employed, in which image data is encoded on the basis of the length of succession of either white or black pixels (run length).
A fixed-length encoding technique is also used. One technique of the fixed-length encoding is vector quantization in which an image data is divided into blocks and a fixed-length code is assigned to each block. In this technique, encoding is performed with a constant compression ratio. However, the information quality of coded data differs from block to block and thus the quality of decoded data or the quality of a reproduced image varies from block to block.
In image communication devices such as a facsimile device, a reversible encoding algorithm is usually employed so that a decoding device can reproduce an image identical to the original image. In some cases, an irreversible coding algorithm is also employed so as to achieve a higher compression ratio although a certain degree of degradation occurs in a reproduced image.
As described above, in variable-length encoding, the amount of generated codes varies depending on the image, and thus the disadvantage of this technique is that it is difficult to encode the data with a compression ratio no greater than a particular desired value (and thus it is difficult to encode the data with a particular memory capacity).
On the other hand, in fixed-length encoding, although it is possible to maintain the compression ratio at a desired value, there is a problem that local degradation occurs in the quality of decoded data.